<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="author" content="zhangcheng">
	<title>无卡注销</title>
	<script language="javascript" type="text/javascript" src="../script/print.js"></script>
	<script language="javascript" src="../script/common.js" type="text/javascript"></script>
	<script language="javascript" type="text/javascript">
		//页面控件初始化
		function load(){			
			Eui.showNavigation();
			setPages(["searchView","detview"]);
			CardMgnt.cardUser.show("userinfo",null,CardMgnt.PERSONALVIEW)
		}
		
		
		//查询显示信息明细
		function searchCard(){
			if(!checkForm(searchCardForm))return;
			var asn = searchCardForm.asn.value;
			DWR.call("mgntQueryService.checkRevWithoutCard",asn,function(data){
				var cardUser = data.cardUser;
				var cardObj = CardMgnt.convertCardObject(data);
				Common.setValues(searchCardForm,cardObj);
				CardMgnt.cardUser.showData("userinfo",data,CardMgnt.PERSONALVIEW)
				if (cardUser.type != CardUserType.NAME){
					showWarning("卡片不是个人卡！");return;
				}
				$("revocationbtn").disabled = false;
				searchCardForm.feeAmount.value = Format.fenToYuan(CardMgnt.getFee(Constants.ACCOUNT_FEE_REVOCATE_CARD,data.cardType.id));
			},{blockScreen:true})
		}
		
		//销户
		function revocation(){
			if(!showQuestion("是否做个人无卡销户？")) return;
			DWR.call("cardMgntService.cardLossRevocation",searchCardForm.asn.value,function(data){
				showInformation("销户成功！");
				switchPage("detview");
				CardMgnt.showPrintView("detview","kill_without_card_bill",data.logId,"无卡销户凭证");
				try{
					WebPrint.print("billview");
				}catch(e){
					showError("打印单据出错:"+e.description)
				}
			},{blockScreen:true});
		}
		
		function onCancel(){
			switchPage("searchView");
			CardMgnt.resetForm(searchCardForm)
			$("revocationbtn").disabled = true;
			searchCardForm.reset();
			$(CardMgnt.cardUser.formName).reset();
		}
	</script>
</head>
<body onload="load()">
	<!--页面导航-->
	<div class="nav"><div id="nav">&nbsp;</div></div>

	<div id="searchView">
		<div id="userinfo"></div>
		<form name="searchCardForm" id="searchCardForm">
			<div class="form">
				<div class="formTitle">卡片信息</div>
				<table cellSpacing="0" cellPadding="4" width="100%" border="0" class="label6">
					<tr>
						<td><label>卡&nbsp;&nbsp;&nbsp;&nbsp;号</label> <input type="text" name="asn" onblur="checkV(this,'asn',true)"><span class="des">*</span></td>
						<td><label>卡子类型</label> <input type="text" name="subCardTypeText" readonly class="readonly"></td>
					</tr>	
					<tr>
						<td><label>卡片状态</label> <input type="text" name="statusText" readonly class="readonly"></td>
						<td><label>黑名单类型</label> <input type="text" name="blackTypeText" readonly class="readonly"></td>
					</tr>
					<tr>
						<td><label>备用金余额</label> <input type="text" name="spareBalance" readonly class="readonly"> 元</td>
						<td><label>备用积分</label> <input type="text" name="spareLoyaltyBalance" readonly class="readonly"> 分</td>							
					</tr>	
					<tr>
						<td><label>手续费</label> <input type="text" name="feeAmount" readonly class="readonly"></td>
					</tr>	
				</table>
			</div>
		</form>
		<p>
			<button onclick="searchCard()">查 询</button>
			<button onclick="revocation()" id="revocationbtn" disabled>销 户</button>
			<button onclick="onCancel()">重 置</button>
		</p>
	</div>
	
	<div id="detview"style="display:none;">
	</div>
</body>
</html>
